
class P948_39643 {

	static int[] array;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		generateFibs();
		
		int n = Integer.parseInt(readLn());
		
		for (int k = 0; k < n; k++) {
			process(Integer.parseInt(readLn()));
		}
		
	}

	private static void process(int x) {
//		System.out.println("x: " + x);
		int index = array.length;
		
		for (int k = 0; k < array.length; k++) {
//			System.out.println("array[" + k + "] = " + array[k]);
			if (x < array[k]) {
				index = k;
//				System.out.println("break");
				break;
			}
		}
		
		int counter = 0;
		StringBuilder sb = new StringBuilder();
		for (int k = index - 1; k >= 0; k--) {
			if (counter != x &&  counter + array[k] <= x) {
				counter += array[k];
				sb.append("1");
			}
			else sb.append("0");
		}
		
		System.out.println(x +  " = " + sb.toString() + " (fib)");
		
	}

	private static void generateFibs() {
		array = new int[39];
		
		array[0] = 1;
		array[1] = 2;
		
		for (int k = 2; k < array.length; k++) {
			array[k] = array[k-1] + array[k-2];
		}
		
		
	}

	static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuffer buffer = new StringBuffer();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char)car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
            System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) { return (null);}
        if ((car < 0) && (buffer.length() == 0)) return (null);
        return (buffer.toString()).trim();
    }
	
}
